/*
 * @LastEditors: Yang.Zzz
 * @LastEditTime: 2024-05-17 09:34:30
 */
export default {  
  namespaced: true, // 启用命名空间  
  state: () => ({  
    name: 'Guest',  
    taskList: []
  }),  
  mutations: {  
    SET_NAME(state, name) {  
      state.name = name;  
    },  
    SET_TASKLIST(state, list) {  
      state.taskList = list;  
    },  
  },  
  actions: {  
    async setName({ commit }, name) {  
      // 模拟异步操作  
      await new Promise(resolve => setTimeout(resolve, 1000));  
      commit('SET_NAME', name);  
    }, 

    setTaskList({ commit }, list) {  
      commit('SET_TASKLIST', list);  
    }, 

  },  
  getters: {  
    fullName: (state) => `Full Name: ${state.name}`,  
  },  
};